package com.zone.service.service.impl;

import java.util.List;
import com.zone.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zone.service.mapper.ElectronicLockMapper;
import com.zone.service.domain.ElectronicLock;
import com.zone.service.service.IElectronicLockService;

/**
 * 电子锁Service业务层处理
 * 
 * @author liuyang
 * @date 2025-11-20
 */
@Service
public class ElectronicLockServiceImpl implements IElectronicLockService 
{
    @Autowired
    private ElectronicLockMapper electronicLockMapper;

    /**
     * 查询电子锁
     * 
     * @param id 电子锁主键
     * @return 电子锁
     */
    @Override
    public ElectronicLock selectElectronicLockById(Long id)
    {
        return electronicLockMapper.selectElectronicLockById(id);
    }

    /**
     * 查询电子锁列表
     * 
     * @param electronicLock 电子锁
     * @return 电子锁
     */
    @Override
    public List<ElectronicLock> selectElectronicLockList(ElectronicLock electronicLock)
    {
        return electronicLockMapper.selectElectronicLockList(electronicLock);
    }

    /**
     * 新增电子锁
     * 
     * @param electronicLock 电子锁
     * @return 结果
     */
    @Override
    public int insertElectronicLock(ElectronicLock electronicLock)
    {
        electronicLock.setCreateTime(DateUtils.getNowDate());
        return electronicLockMapper.insertElectronicLock(electronicLock);
    }

    /**
     * 修改电子锁
     * 
     * @param electronicLock 电子锁
     * @return 结果
     */
    @Override
    public int updateElectronicLock(ElectronicLock electronicLock)
    {
        electronicLock.setUpdateTime(DateUtils.getNowDate());
        return electronicLockMapper.updateElectronicLock(electronicLock);
    }

    /**
     * 批量删除电子锁
     * 
     * @param ids 需要删除的电子锁主键
     * @return 结果
     */
    @Override
    public int deleteElectronicLockByIds(Long[] ids)
    {
        return electronicLockMapper.deleteElectronicLockByIds(ids);
    }

    /**
     * 删除电子锁信息
     * 
     * @param id 电子锁主键
     * @return 结果
     */
    @Override
    public int deleteElectronicLockById(Long id)
    {
        return electronicLockMapper.deleteElectronicLockById(id);
    }

    /**
     * 批量插入电子锁数据
     *
     * @param electronicLockList
     * @return 结果
     */
    @Override
    public int batchInsertElectronicLock(List<ElectronicLock> electronicLockList) {
        return electronicLockMapper.batchInsertElectronicLock(electronicLockList);
    }
}
